{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/containers/DialogInput.tsx\",\n  _s = $RefreshSig$();\nimport React from \"react\";\nimport { DialogInput as DialogInputComponent } from \"../components\";\nimport { Context } from \"../index\";\nimport { observer } from \"mobx-react-lite\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst DialogInput = _ref => {\n  _s();\n  let {\n    chat\n  } = _ref;\n  const {\n    store\n  } = React.useContext(Context);\n  const [value, setValue] = React.useState(false);\n  const [textField, setTextField] = React.useState('');\n  const [emojiPickerVisible, setEmojiPickerVisible] = React.useState(false);\n  const [flagForStyle, setFlagForStyle] = React.useState(false);\n  const [cursorPosition, setCursorPosition] = React.useState(0);\n  const [isRecording, setIsRecording] = React.useState(false);\n  const [uploaded, setUploaded] = React.useState();\n  const [mediaRecorder, setMediaRecorder] = React.useState(null);\n  const pickerRef = React.useRef(null);\n  const textAreaRef = React.useRef(null);\n  const maxSizeMessage = 500;\n  React.useEffect(() => {\n    var _textAreaRef$current;\n    let dialogListInput = {\n      items: store.getDialogInput().items ? [...store.getDialogInput().items] : []\n    };\n    (_textAreaRef$current = textAreaRef.current) === null || _textAreaRef$current === void 0 ? void 0 : _textAreaRef$current.focus();\n    if (textField.length > maxSizeMessage * 0.05) {\n      setFlagForStyle(true);\n    } else {\n      setFlagForStyle(false);\n    }\n    dialogListInput.items[chat.id] = {\n      inputText: textField\n    };\n    store.setDialogInput({\n      ...store.getDialogInput(),\n      ...dialogListInput\n    });\n  }, [textField]);\n  React.useEffect(() => {\n    var _uploaded$items;\n    if (textField.length > 0 || (uploaded === null || uploaded === void 0 ? void 0 : (_uploaded$items = uploaded.items) === null || _uploaded$items === void 0 ? void 0 : _uploaded$items.length) > 0) {\n      setValue(true);\n    } else {\n      setValue(false);\n    }\n  }, [textField, uploaded]);\n  React.useEffect(() => {\n    if (emojiPickerVisible) {\n      const handleClick = e => {\n        var _pickerRef$current;\n        if (!pickerRef.current) return;\n        if (!((_pickerRef$current = pickerRef.current) !== null && _pickerRef$current !== void 0 && _pickerRef$current.contains(e.target))) {\n          var _textAreaRef$current2;\n          (_textAreaRef$current2 = textAreaRef.current) === null || _textAreaRef$current2 === void 0 ? void 0 : _textAreaRef$current2.focus();\n          setEmojiPickerVisible(false);\n        }\n      };\n      document.addEventListener('click', handleClick);\n      return () => {\n        document.removeEventListener('click', handleClick);\n      };\n    }\n  }, [emojiPickerVisible]);\n  React.useEffect(() => {\n    var _textAreaRef$current3;\n    if ((_textAreaRef$current3 = textAreaRef.current) !== null && _textAreaRef$current3 !== void 0 && _textAreaRef$current3.selectionEnd) {\n      textAreaRef.current.selectionEnd = cursorPosition;\n    }\n  }, [cursorPosition]);\n  React.useEffect(() => {\n    if (store.getDialogInput().items && store.getDialogInput().items[chat.id]) {\n      setTextField([...store.getDialogInput().items][chat.id].inputText);\n    } else {\n      setTextField('');\n    }\n    setCursorPosition(0);\n  }, [chat]);\n  React.useEffect(() => {\n    var _tempUploaded$items;\n    setUploaded({\n      items: []\n    });\n    const tempUploaded = {\n      ...store.getUploadedContentForChats()\n    };\n    if ((tempUploaded === null || tempUploaded === void 0 ? void 0 : (_tempUploaded$items = tempUploaded.items) === null || _tempUploaded$items === void 0 ? void 0 : _tempUploaded$items.length) > 0 && tempUploaded.items[chat.id]) {\n      setUploaded({\n        items: tempUploaded.items[chat.id].uploadedContent.items\n      });\n    }\n  }, [chat, store.uploadedContentForChats]);\n  const onRecord = () => {\n    navigator.mediaDevices.getUserMedia({\n      audio: true\n    }).then(onRecording).catch(onError);\n  };\n  const onRecording = stream => {\n    const recorder = new MediaRecorder(stream);\n    setMediaRecorder(recorder);\n    recorder.start();\n    recorder.onstart = () => {\n      setIsRecording(true);\n    };\n    recorder.onstop = () => {\n      setIsRecording(false);\n    };\n    recorder.ondataavailable = e => {\n      //const file = new File([e.data], 'audio.webm');\n      const audioURL = window.URL.createObjectURL(e.data);\n      new Audio(audioURL).play();\n    };\n  };\n  const onStopRecording = () => {\n    mediaRecorder === null || mediaRecorder === void 0 ? void 0 : mediaRecorder.stop();\n    setIsRecording(false);\n  };\n  const onError = err => {\n    console.log('The following error occured: ' + err);\n  };\n  const toggleEmojiPicker = () => {\n    var _textAreaRef$current4;\n    (_textAreaRef$current4 = textAreaRef.current) === null || _textAreaRef$current4 === void 0 ? void 0 : _textAreaRef$current4.focus();\n    setEmojiPickerVisible(!emojiPickerVisible);\n  };\n  const addEmoji = identifier => {\n    const ref = textAreaRef.current;\n    ref === null || ref === void 0 ? void 0 : ref.focus();\n    const start = textField.substring(0, ref === null || ref === void 0 ? void 0 : ref.selectionStart) || '';\n    const end = textField.substring((ref === null || ref === void 0 ? void 0 : ref.selectionStart) || 500) || '';\n    setTextField(start + identifier + end);\n    setCursorPosition(start.length + identifier.length);\n  };\n  const uploadDocumentHandler = React.useCallback(e => {\n    let collectionFiles = [];\n    if (e.target.files) {\n      [...e.target.files].forEach(item => {\n        const file = item;\n        collectionFiles.push(file);\n      });\n      store.uploadFiles(collectionFiles);\n    }\n    e.target.value = '';\n  }, [store]);\n  const handleSendMessage = () => {\n    if (textField.length - 1 <= maxSizeMessage) {\n      setTextField('');\n    }\n  };\n  const handleDeleteContent = contentId => {\n    store.deleteUploadedContent(chat.id, contentId);\n  };\n  return /*#__PURE__*/_jsxDEV(DialogInputComponent, {\n    toggleEmojiPicker: toggleEmojiPicker,\n    emojiPickerVisible: emojiPickerVisible,\n    setEmojiPickerVisible: setEmojiPickerVisible,\n    value: value,\n    textField: textField,\n    setTextField: setTextField,\n    maxSizeMessage: maxSizeMessage,\n    uploadDocumentHandler: uploadDocumentHandler,\n    handleSendMessage: handleSendMessage,\n    pickerRef: pickerRef,\n    addEmoji: addEmoji,\n    flagForStyle: flagForStyle,\n    textAreaRef: textAreaRef,\n    uploaded: uploaded || {\n      items: []\n    },\n    callbackOnDeleteContent: handleDeleteContent,\n    onRecord: onRecord,\n    onStopRecording: onStopRecording,\n    isRecording: isRecording\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 179,\n    columnNumber: 9\n  }, this);\n};\n_s(DialogInput, \"xMfzM3Qh/GmqPyzOnwnLQxsRrgM=\");\n_c = DialogInput;\nexport default _c2 = observer(DialogInput);\nvar _c, _c2;\n$RefreshReg$(_c, \"DialogInput\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","DialogInput","DialogInputComponent","Context","observer","chat","store","useContext","value","setValue","useState","textField","setTextField","emojiPickerVisible","setEmojiPickerVisible","flagForStyle","setFlagForStyle","cursorPosition","setCursorPosition","isRecording","setIsRecording","uploaded","setUploaded","mediaRecorder","setMediaRecorder","pickerRef","useRef","textAreaRef","maxSizeMessage","useEffect","dialogListInput","items","getDialogInput","current","focus","length","id","inputText","setDialogInput","handleClick","e","contains","target","document","addEventListener","removeEventListener","selectionEnd","tempUploaded","getUploadedContentForChats","uploadedContent","uploadedContentForChats","onRecord","navigator","mediaDevices","getUserMedia","audio","then","onRecording","catch","onError","stream","recorder","MediaRecorder","start","onstart","onstop","ondataavailable","audioURL","window","URL","createObjectURL","data","Audio","play","onStopRecording","stop","err","console","log","toggleEmojiPicker","addEmoji","identifier","ref","substring","selectionStart","end","uploadDocumentHandler","useCallback","collectionFiles","files","forEach","item","file","push","uploadFiles","handleSendMessage","handleDeleteContent","contentId","deleteUploadedContent"],"sources":["/data/messenger.client/src/containers/DialogInput.tsx"],"sourcesContent":["import React from \"react\";\nimport {DialogInputContainerProps} from \"../models/props/DialogInputContainerProps\";\nimport {ContentListResponse} from \"../models/response/ContentListResponse\";\nimport {ShortChatList} from \"../models/uploadedStoreModel/ShortChatList\";\nimport {InputTextList} from \"../models/inputDialogModel/InputTextList\";\nimport {DialogInput as DialogInputComponent} from \"../components\";\nimport {Context} from \"../index\";\nimport {observer} from \"mobx-react-lite\";\n\nconst DialogInput: React.FC<DialogInputContainerProps> = ({chat}) => {\n    const {store} = React.useContext(Context);\n    const [value, setValue] = React.useState<boolean>(false);\n    const [textField, setTextField] = React.useState<string>('');\n    const [emojiPickerVisible, setEmojiPickerVisible] = React.useState<boolean>(false);\n    const [flagForStyle, setFlagForStyle] = React.useState<boolean>(false);\n    const [cursorPosition, setCursorPosition] = React.useState<number>(0);\n    const [isRecording, setIsRecording] = React.useState<boolean>(false);\n    const [uploaded, setUploaded] = React.useState<ContentListResponse>();\n    const [mediaRecorder, setMediaRecorder] = React.useState<MediaRecorder | null>(null);\n\n    const pickerRef = React.useRef<null | HTMLDivElement>(null);\n    const textAreaRef = React.useRef<null | HTMLTextAreaElement>(null);\n\n    const maxSizeMessage: number = 500;\n\n    React.useEffect(() => {\n        let dialogListInput: InputTextList = {\n          items: store.getDialogInput().items?\n              [...store.getDialogInput().items]:\n              []\n        };\n        textAreaRef.current?.focus();\n\n        if (textField.length > maxSizeMessage * 0.05) {\n            setFlagForStyle(true);\n        } else {\n            setFlagForStyle(false);\n        }\n\n        dialogListInput.items[chat.id] = {\n            inputText: textField\n        };\n\n        store.setDialogInput({\n            ...store.getDialogInput(),\n            ...dialogListInput\n        });\n    }, [textField]);\n\n    React.useEffect(() => {\n        if (textField.length > 0 || uploaded?.items?.length! > 0) {\n            setValue(true);\n        } else {\n            setValue(false);\n        }\n    }, [textField, uploaded]);\n\n    React.useEffect(() => {\n        if (emojiPickerVisible) {\n            const handleClick = (e: any) => {\n                if (!pickerRef.current) return;\n                if (!pickerRef.current?.contains(e.target)) {\n                    textAreaRef.current?.focus();\n                    setEmojiPickerVisible(false);\n                }\n            }\n\n            document.addEventListener('click', handleClick);\n\n            return () => {\n                document.removeEventListener('click', handleClick)\n            }\n        }\n    }, [emojiPickerVisible]);\n\n    React.useEffect(() => {\n        if (textAreaRef.current?.selectionEnd!) {\n            textAreaRef.current.selectionEnd = cursorPosition;\n        }\n    }, [cursorPosition]);\n\n    React.useEffect(() => {\n        if (store.getDialogInput().items && store.getDialogInput().items[chat.id]) {\n            setTextField([...store.getDialogInput().items][chat.id].inputText);\n        } else {\n            setTextField('');\n        }\n        setCursorPosition(0);\n    }, [chat]);\n\n    React.useEffect(() => {\n        setUploaded({items: []});\n        const tempUploaded: ShortChatList = {...store.getUploadedContentForChats()};\n\n        if (tempUploaded?.items?.length > 0 &&\n            tempUploaded.items[chat.id]\n        ) {\n            setUploaded({\n                items: tempUploaded.items[chat.id].uploadedContent.items\n            });\n        }\n    }, [chat, store.uploadedContentForChats]);\n\n    const onRecord = () => {\n        navigator.mediaDevices.getUserMedia({ audio: true }).\n        then(onRecording).\n        catch(onError);\n    };\n\n    const onRecording = (stream: MediaStream) => {\n        const recorder = new MediaRecorder(stream);\n        setMediaRecorder(recorder);\n\n        recorder.start();\n\n        recorder.onstart = () => {\n            setIsRecording(true);\n        };\n\n        recorder.onstop = () => {\n            setIsRecording(false);\n        };\n\n        recorder.ondataavailable = e => {\n            //const file = new File([e.data], 'audio.webm');\n            const audioURL = window.URL.createObjectURL(e.data);\n            new Audio(audioURL).play();\n        };\n    };\n\n    const onStopRecording = () => {\n        mediaRecorder?.stop();\n        setIsRecording(false);\n    }\n\n    const onError = (err: string) => {\n        console.log('The following error occured: ' + err);\n    };\n\n    const toggleEmojiPicker = () => {\n        textAreaRef.current?.focus();\n        setEmojiPickerVisible(!emojiPickerVisible);\n    }\n\n    const addEmoji = (identifier: string) => {\n        const ref = textAreaRef.current;\n        ref?.focus();\n\n        const start: string = textField.substring(0, ref?.selectionStart) || '';\n        const end: string = textField.substring(ref?.selectionStart || 500) || '';\n\n        setTextField(start + identifier + end);\n        setCursorPosition(start.length + identifier.length);\n    }\n\n    const uploadDocumentHandler = React.useCallback( (e: React.ChangeEvent<HTMLInputElement>) => {\n        let collectionFiles: File[] = [];\n        if (e.target.files) {\n            [...e.target.files].forEach((item) => {\n                const file: File = item;\n                collectionFiles.push(file);\n            });\n            store.uploadFiles(collectionFiles);\n        }\n        e.target.value = '';\n    }, [store]);\n\n    const handleSendMessage = () => {\n        if (textField.length - 1 <= maxSizeMessage) {\n            setTextField('');\n        }\n    }\n\n    const handleDeleteContent = (contentId: string) => {\n        store.deleteUploadedContent(chat.id, contentId);\n    }\n\n    return (\n        <DialogInputComponent\n            toggleEmojiPicker={toggleEmojiPicker}\n            emojiPickerVisible={emojiPickerVisible}\n            setEmojiPickerVisible={setEmojiPickerVisible}\n            value={value}\n            textField={textField}\n            setTextField={setTextField}\n            maxSizeMessage={maxSizeMessage}\n            uploadDocumentHandler={uploadDocumentHandler}\n            handleSendMessage={handleSendMessage}\n            pickerRef={pickerRef}\n            addEmoji={addEmoji}\n            flagForStyle={flagForStyle}\n            textAreaRef={textAreaRef}\n            uploaded={uploaded || {items: []}}\n            callbackOnDeleteContent={handleDeleteContent}\n            onRecord={onRecord}\n            onStopRecording={onStopRecording}\n            isRecording={isRecording}\n        />\n    );\n}\n\nexport default observer(DialogInput);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAKzB,SAAQC,WAAW,IAAIC,oBAAoB,QAAO,eAAe;AACjE,SAAQC,OAAO,QAAO,UAAU;AAChC,SAAQC,QAAQ,QAAO,iBAAiB;AAAC;AAEzC,MAAMH,WAAgD,GAAG,QAAY;EAAA;EAAA,IAAX;IAACI;EAAI,CAAC;EAC5D,MAAM;IAACC;EAAK,CAAC,GAAGN,KAAK,CAACO,UAAU,CAACJ,OAAO,CAAC;EACzC,MAAM,CAACK,KAAK,EAAEC,QAAQ,CAAC,GAAGT,KAAK,CAACU,QAAQ,CAAU,KAAK,CAAC;EACxD,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGZ,KAAK,CAACU,QAAQ,CAAS,EAAE,CAAC;EAC5D,MAAM,CAACG,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGd,KAAK,CAACU,QAAQ,CAAU,KAAK,CAAC;EAClF,MAAM,CAACK,YAAY,EAAEC,eAAe,CAAC,GAAGhB,KAAK,CAACU,QAAQ,CAAU,KAAK,CAAC;EACtE,MAAM,CAACO,cAAc,EAAEC,iBAAiB,CAAC,GAAGlB,KAAK,CAACU,QAAQ,CAAS,CAAC,CAAC;EACrE,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